<?php
include '../../public/index.php';
$data = json_decode(file_get_contents('php://input'), true);
if(empty($data["type"])||empty($data["app_name"])||empty($data["grade"])||empty($data["count"])||empty($data["edition"])||empty($data["update_time"])||empty($data["info"])){die(json_encode(array("code" => 1, "message" => "json格式错误")));return;}
$query = mysqli_query($connect, "insert into app_info values(null,'{$data["type"]}','{$data["app_name"]}','{$data["grade"]}','{$data["count"]}','{$data["edition"]}','{$data["update_time"]}','{$data["info"]}');");
if (!$query) {mysqli_close($connect);die(json_encode(array("code" => 500, "message" => "添加数据失败")));}
mysqli_close($connect); 
die(json_encode(array("code" => 0,"message"=>"添加数据成功")));
